package com.example.newspublish.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.newspublish.annotation.AutoFill;
import com.example.newspublish.pojo.entity.Comment;
import com.example.newspublish.util.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CommentMapper extends BaseMapper<Comment> {


    @AutoFill(value = OperationType.INSERT)
    int insertComment(Comment comment);

    List<Comment> getAllCommentList();

    @Delete("delete from comment where id = #{id}")
    void deleteById(Long id);

}
